package cn.itcast.ssm.controller;

import cn.itcast.ssm.pojo.User;
import cn.itcast.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("findUser")
    public List<User> findUser(){

        List<User> list = userService.findUser();
        return list;
    }

    @RequestMapping("findUserbyid")
    public User findUserByid(){

        User user = userService.findUserById("1");
        return user;
    }
}
